

import lejos.pc.comm.NXTComm;
import lejos.pc.comm.NXTCommException;
import lejos.pc.comm.NXTCommFactory;
import lejos.pc.comm.NXTInfo;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ryanbelt
 */
public class CommTest
{
    public static void main(String[] args) throws NXTCommException
    {
        System.out.println("Beginning execution...");
        NXTComm conn = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH);
        NXTInfo[] arr = conn.search(null, NXTCommFactory.BLUETOOTH);
        for(int i = 0; i < arr.length; i++)
        {
            System.out.println("NXT #" + i + " Name: " + arr[i].name + " Address: " + arr[i].deviceAddress);
        }
        System.out.println("Ending execution...");
    }

}
